/*
 * File contains functions for automatic ;
 * detection of tags - without a PC ;
 * connected. ;
 */
#include "automatic.h"
unsigned char	protocol;

#include <avr/delay.h>

#include "globals.h"

#define F_CPU 8000000UL

/*
 =======================================================================================================================
 =======================================================================================================================
 */

unsigned char FindTags(unsigned char protocol)
{
	/*~~~~~~~~~~~~~~~~~~~~~~~~*/
	unsigned char	command[10];
	/*~~~~~~~~~~~~~~~~~~~~~~~~*/

	while(1)
	{

		if((protocol == 0x00) || (protocol == 0x01))
		{	// ISO15693 //
			command[0] = ChipStateControl;	// turn on RF driver
			command[1] = 0x21;
			command[2] = ISOControl;		// set register 0x01 for ISO15693 operation
			command[3] = 0x02;
			WriteSingle(command, 4);

			_delay_ms(5);
			flags = 0x06; // 16 slots
                          //flags = 0x26; //1 slot

			command[0] = 0x00;
		//	InventoryRequest(command, 0);	// send Inventory request //
void spi_send_pack(void);
			command[0] = ChipStateControl;	// turn off RF driver //
			command[1] = 0x01;
			WriteSingle(command, 2);
			_delay_ms(10);
 /* 
command[0] = IRQStatus;
command[1] = IRQMask;

if (SPIMODE)
ReadCont(command, 2);
else
ReadSingle(command, 1);
*/
                        // clear any IRQs //
		}



	

	}	/* while */
}		/* FindTags */




